home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
TPHERS01.ARJ
/
TPHERSH.DOC
< prev
next >
Wrap
Text File
|
1991-09-08
|
4KB
|
132 lines
DOCUMENTATION OF THE UNIT TPHERSH
This is an attempt to document the functions and procedures of the
TPHERSH unit.
Types:
HersheyFont = array[#32..#127] of integer;
The fonts are used to map the normal ascii characters into Hershey
symbols. The TPHERSH unit keeps track of a current font, which is
used in all the string manipulation procedures.
pHersheyFont = ^HersheyFont
Pointer to a HersheyFont which is used in the HersheySetFont
procedure.
Global variables:
HersheyX, HersheyY : integer;
The current Hershey pen position
Procedures and functions:
procedure HersheySetFontFileName(s : string);
Set the name of a HFN files to be used for reading fonts. If this
procedure is not called, the default font HERSH.HFN will be used.
Not that although HERSH.HFN does not exist in the archive, it can
simply be produced by the command
perl her2hfn.pl *.oc* > hersh.hfn
procedure HersheyLoadFont;
Loads the fontfile defined by HersheySetFont into memory. The
default font is HERSH.HFN. See HersheySetFontFilename for further
information.
procedure HersheyDisplaySymbol(symNum : integer);
Displays the Hershey symbol symNum at the current pen position in
the current size and the current angle. It will write the symbol
horizontally left adjusted, vertically centered at the current
pen position. When the character is finished, the pen position is
updated immeditaly to the right of the character.
procedure HersheyOutTextXY(x,y : integer; s : string);
Outputs the string s at position x,y in the current font and in
the current string justificition, symbol size, and rotation.
procedure HersheyOutText(s : string);
Outputs a string at the current pen position.
procedure HersheySetSymbolSize(xs, ys: double);
Sets the symbol size. The SymbolSize is determined as a percentage
of the external character box with respect to the maximal x value.
Size most characters are much smaller than their character box, the
characters will be smaller than might be believed. Both the height
and width values are determined with respect to the maximal x
value. The height value, though is multiplied by the aspect ratio.
procedure HersheySetMaxX(maxX, aspectRatio : double);
Sets the maximal x value and the aspect ration which are used in
the HersheySetSymbolSize procedure.
procedure HersheyDisposeFont;
Reclaims all the memory allocated when loading the font.
procedure HersheySetFont(var pFont);
Sets the current font used by HersheyOutText, HersheyOutTextXY, and
HersheyStringWidth;
procedure HersheyMove(x,y : integer);
Move the current pen position to (x,y);
function HersheySymbolWidth(symNum : integer) : double;
Returns the width of a symbol. See discussion on
HersheySetSymbolSize.
function HersheyStringWidth(s : string) : double;
Returns the width of a string. See discussion on
HersheySetSymbolSize.
procedure HersheySetAngle(theta : double);
Changes the angle of writing.
procedure HersheySetStringJustify(Horizontal, Vertical : integer);
Changes the justification of a string as follows:
Horizontal=-1 : Left justify the string (Default)
Horizontal=0 : Center justify the string
Horizontal=1 : Right justify the string
Vertical=-1 : Justify the string at the bottom
Vertical=0 : Center justify the string
Vertical=1 : Top justify the string
Not that HersheySetStringJustify only effects the string procedure.
It has no effect on the justification of HersheyDisplayCharacter.